package com.subaiwang.service.picture;

import com.subaiwang.dao.picture.PictureMapper;
import com.subaiwang.pojo.Pages;
import com.subaiwang.pojo.Picture;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;

@Service("pictureService")
public class PictureServiceImpl implements PictureService{
    @Resource
    private PictureMapper pictureMapper;
    @Override
    public void getPicture(String classify,Pages pages) {
       List<Picture> list=pictureMapper.getPicture(classify,((pages.getPageNo()-1)*pages.getPageSize()),pages.getPageSize());
       pages.setPictureList(list);
    }

    @Override
    public int pictureCount(String classify) {
        return pictureMapper.pictureCount(classify);
    }
}
